package com.whl.sm.vo;

import com.whl.sm.model.assets.ComUnits;
import com.whl.sm.model.inhabitant.AssetsTenant;
import com.whl.sm.model.system.OrgUserInfo;
import lombok.Data;

import java.util.Date;

@Data
public class OrgUserAssetsTenantVo {

    public OrgUserAssetsTenantVo(OrgUserInfo orgUserInfo, AssetsTenant assetsTenant, ComUnits comUnits){
        if (assetsTenant != null){
            this.id = assetsTenant.getId();
            this.validTime = assetsTenant.getValidTime();
            this.visible = assetsTenant.getVisible();
            this.createTime = assetsTenant.getCreateTime();
            this.updateTime = assetsTenant.getUpdateTime();
        }
        if (orgUserInfo != null){
            this.userName = orgUserInfo.getUserName();
            this.linkTel = orgUserInfo.getLinkTel();
            this.linkMail = orgUserInfo.getLinkMail();
            this.gender = orgUserInfo.getGender();
            this.avatar = orgUserInfo.getAvatar();
            this.birthday = orgUserInfo.getBirthday();
        }
        if (comUnits != null){
            this.assetsId = comUnits.getId();
            this.unitCode = comUnits.getUnitCode();
            this.unitArea = comUnits.getUnitArea();
        }
    }

    /**
     * tenant表id
     */
    private String id;

    /**
     * 用户姓名
     */
    private String userName;

    /**
     * 单元id
     */
    private String assetsId;


    /**
     * 单元编号
     */
    private String unitCode;


    /**
     * 单元面积
     */
    private double unitArea;

    /**
     * 租约期限
     */
    private Date validTime;


    /**
     * 生效状态 1:正常 2:停用
     */
    private Integer visible;


    /**
     * 联系电话
     */
    private String linkTel;

    /**
     * 联系邮箱
     */
    private String linkMail;

    /**
     * 头像图片路径
     */
    private String avatar;

    /**
     * 性别 0:female 1:male
     */
    private Integer gender;

    /**
     * 生日
     */
    private String birthday;


    /**
     * 更新时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;
}
